var express = require('express');
var router = express.Router();
var topicService = require("../services/topicService");
var checkUserLogin = require("../middlewares/checkUserLogin");

//创建话题-页面
router.get('/create',checkUserLogin,topicService.create);

//创建话题(数据)
router.post('/createTopic',checkUserLogin,topicService.doCreate);

//话题页面-跳转
router.get('/:_id',topicService.goTopic);

//回复话题
router.post('/replyTopic',topicService.replyTopic);

//对某个话题进行收藏的操作
router.get('/collect/:opt',topicService.collectTopic);

//对某条话题回复点赞
router.post('/pretReply',topicService.pretReply);

//修改话题
router.get('/editTopic/:_id',topicService.editTopic);

module.exports = router;